package com.yupi.springbootinit.model.vo;

import com.yupi.springbootinit.model.entity.ProcessSheetStep;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 工艺单VO
 */
@Data
public class ProcessSheetVO implements Serializable {

    private String id;

    /**
     * 工艺单基础号（如GY202511001）
     */
    private String processSheetNo;

    /**
     * 工艺版次（A/B/C...）
     */
    private String processVersion;

    /**
     * 完整工艺单号（拼接后，如GY202511001-A）
     */
    private String fullProcessSheetNo;

    private Integer sourceType;
    private String sourceId;
    private String sourceNo;
    private Integer quantity;
    private Integer productCount;
    private String materialBrand;
    private String materialSpec;
    private String powderSupplier;
    private Integer plannedBatchCount;
    private LocalDateTime dueDate;
    private String deviceName;
    private String deviceId;
    private String customerName;
    private Integer processStatus;
    private String technicalRequirements;
    private String processFileIds;
    private String createdBy;
    private String createdByName;
    private String departmentId;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    /**
     * 产品明细列表
     */
    private List<ProductDetailVO> products;

    /**
     * 工序步骤列表
     */
    private List<ProcessSheetStep> steps;

    /**
     * 版次计划列表
     */
    private List<BatchPlanVO> batches;

    // ==================== 内部类 ====================

    @Data
    public static class ProductDetailVO implements Serializable {
        private String id;
        private String processSheetId;
        private String orderItemId;
        private String productCode;
        private String productName;
        private String specification;
        private Integer quantity;
        private String partDrawingNo;
        private BigDecimal unitWeight;
        private BigDecimal productHeight;
        private Integer sortOrder;
        private String remark;
        private LocalDateTime createTime;
        private LocalDateTime updateTime;
    }

    @Data
    public static class BatchPlanVO implements Serializable {
        private String id;
        private String processSheetId;
        private Integer batchNo;
        private LocalDateTime createTime;
        private LocalDateTime updateTime;
        private List<BatchProductVO> products;
    }

    @Data
    public static class BatchProductVO implements Serializable {
        private String id;
        private String batchId;
        private String processSheetId;
        private String productId;
        private String productCode;
        private String productName;
        private Integer productionQuantity;
        private LocalDateTime createTime;
        private LocalDateTime updateTime;
    }

    private static final long serialVersionUID = 1L;
}